package com.webank.webase.node.mgr.deploy.entity;

import java.util.Date;

import com.webank.webase.node.mgr.base.enums.HostStatusEnum;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@EqualsAndHashCode
@ToString
@NoArgsConstructor
public class TbHost {

    public static TbHost init(int agencyId,
                               String agencyName,
                               String ip,
                               String sshUser,
                               int sshPort,
                               String rootDir,
                               HostStatusEnum hostStatusEnum,
                               int dockerPort,
                               String remark
                              ){
        Date now = new Date();
        TbHost tbHost = new TbHost();
        tbHost.setAgencyId(agencyId);
        tbHost.setAgencyName(agencyName);
        tbHost.setIp(ip);
        tbHost.setSshUser(sshUser);
        tbHost.setSshPort(sshPort);
        tbHost.setRootDir(rootDir);
        tbHost.setDockerPort(dockerPort);
        tbHost.setStatus(hostStatusEnum.getId());
        tbHost.setRemark(remark);
        tbHost.setCreateTime(now);
        tbHost.setModifyTime(now);
        return tbHost;
    }
    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.id
     *
     * @mbg.generated
     */
    private Integer id;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.agency_id
     *
     * @mbg.generated
     */
    private Integer agencyId;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.agency_name
     *
     * @mbg.generated
     */
    private String agencyName;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.ip
     *
     * @mbg.generated
     */
    private String ip;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.ssh_user
     *
     * @mbg.generated
     */
    private String sshUser;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.ssh_port
     *
     * @mbg.generated
     */
    private Integer sshPort;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.root_dir
     *
     * @mbg.generated
     */
    private String rootDir;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.docker_port
     *
     * @mbg.generated
     */
    private Integer dockerPort;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.status
     *
     * @mbg.generated
     */
    private Byte status;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.remark
     *
     * @mbg.generated
     */
    private String remark;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.create_time
     *
     * @mbg.generated
     */
    private Date createTime;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tb_host.modify_time
     *
     * @mbg.generated
     */
    private Date modifyTime;
}